// eslint-disable-next-line import/no-extraneous-dependencies
import uni from '@dcloudio/vite-plugin-uni';
// eslint-disable-next-line import/no-extraneous-dependencies
// import eslint from 'vite-plugin-eslint';

import components from 'unplugin-vue-components/vite';
import autoImport from 'unplugin-auto-import/vite';
import commonjs from '@rollup/plugin-commonjs'
// import commonjs from 'vite-plugin-commonjs'

export const getPlugins = () => [
  uni(),
  commonjs(),
//   eslint({ cache: false }),
  components({
    dirs: ['src/components'], dts: 'types/components.d.ts', deep: true,
  }),
  autoImport({
    // 'pinia', 'vue-i18n'
    imports: ['vue'],
    // dirs: ['src/utils'], // 配置自动导入的目录
    dts: 'types/auto-import.d.ts',
    eslintrc: {
      // 默认false, true启用。false生成一次就可以，避免每次工程启动都生成
      enabled: false,
      filepath: './.eslintrc-auto-import.json', // 生成json文件
      globalsPropValue: true,
    }
  })
];
